<%@ page import="yanglei.day0109.travel.dao.TourRouteDao" %>
<%@ page import="yanglei.day0109.travel.dao.impl.TourRouteDaoImpl" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="yanglei.day0109.travel.po.TourRoute" %>
<%@ page import="java.util.List" %>
<%-- 指定jstl标签库前缀，引用uri--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 杨雷
  Date: 2023/1/9
  Time: 20:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>青年旅行社服务平台</title>
    <%
        TourRouteDao tourRouteDao = new TourRouteDaoImpl();
        Map<String,Object> map = new HashMap<>();
        String searchName = request.getAttribute("searchName") == null ? "" :
                String.valueOf(request.getAttribute("searchName"));
        if (!"".equals(searchName)) {
            map.put("trName", searchName);
        }
        List<TourRoute> tourRoutes = tourRouteDao.queryTourRouteByType(map);

    %>
</head>
<body>
<div>
    <table>
        <tr>
            <th>旅行线路名称</th>
            <th>类型</th>
            <th>价格(元)</th>
            <th>咨询电话</th>
            <th>咨询人</th>
            <th>创建日期</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${tourRoutes}" var="ts" varStatus="vs">
        <tr <c:if test="${vs.index%2==0}"> style="background-color: aqua;" </c:if> >
            <td>${ts}</td>
            <td></td>
            <td></td>
            <td></td>

        </c:forEach>

    </table>
</div>
</body>
</html>
